package com.ruoyi.school.knowledge.controller;

import com.ruoyi.school.knowledge.domain.Knowledge;
import com.ruoyi.school.knowledge.service.IKnowledgeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class CustomKnowledgeController
{
    @Autowired
    private IKnowledgeService knowledgeService;

    @RequestMapping("/school/knowledge/getKnow")
    @ResponseBody
    public String getKnow(Long id)
    {
        Knowledge k =  knowledgeService.selectKnowledgeById(id);
        if(k!=null) {
            return k.getContent();
        }
        else
        {
            return "";
        }
    }
}
